Skip to content

fix(concerto-core): throw IllegalModelException for primitive nested paths - #1628

Open
Atharva15007 wants to merge 1 commit into
accordproject:mainfrom
Atharva15007:fix/nested-property-illegal-model-exception
Open

Atharva15007 wants to merge 1 commit into
accordproject:mainfrom
Atharva15007:fix/nested-property-illegal-model-exception

Conversation

@Atharva15007

@Atharva15007 Atharva15007 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1627

-Fixes ClassDeclaration.getNestedProperty() to throw IllegalModelException instead of a generic JavaScript Error when nested property traversal encounters a primitive or enum property.

Changes

-Replaced the generic Error with IllegalModelException, including the model file and AST location context.
-Updated the regression test to verify that getNestedProperty() throws the expected IllegalModelException while preserving the existing error-message assertion.

Flags

-None

Screenshots or Video

-N/A

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

…paths

Signed-off-by: Atharva15007 <datharva157@gmail.com>
@mira-accord-project

Copy link
Copy Markdown

Thank you for this change. It replaces the generic Error that getNestedProperty() throws when a property path runs through a primitive or enum with an IllegalModelException, which is the exception type the method documents, and it updates the existing test to assert that type.

We have requested reviews from the Concerto maintainers. The CI runs are waiting for a maintainer to approve them before they start, so they will show as pending until then.

Drafted by an Accord Project agent, reviewed by a maintainer.

@mira-accord-project mira-accord-project Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix. getNestedProperty() now throws IllegalModelException when a path runs through a primitive or enum, as its JSDoc and api.txt already promise. It matches the other throw in that method. IllegalModelException was already imported, the message text is unchanged, and the exception is an Error subclass, so existing catch-all callers keep working. The test now checks both the type and the message. I found nothing that needs changing, and it looks ready for a maintainer to approve. One housekeeping point below.

Nothing blocking; some suggestions below. Findings: 1 nit.

  • nit · hygiene: Pull request #1629 makes the same change for issue #1627 (the same two lines in getNestedProperty() and the same test update). Only one of the two needs to merge, so the other should be closed once a maintainer picks one.

Automated review by Mira, an Accord Project agent, at dcff0ec. Findings are labelled blocking, should-fix or nit; a maintainer makes the final call.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClassDeclaration.getNestedProperty() throws generic Error instead of IllegalModelException for primitive or enum properties

1 participant